\(\int \sqrt {a+b x^n+c x^{2 n}} \, dx\) [571]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [F]
   Fricas [F(-2)]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 18, antiderivative size = 139 \[ \int \sqrt {a+b x^n+c x^{2 n}} \, dx=\frac {x \sqrt {a+b x^n+c x^{2 n}} \operatorname {AppellF1}\left (\frac {1}{n},-\frac {1}{2},-\frac {1}{2},1+\frac {1}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{\sqrt {1+\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}} \sqrt {1+\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}}} \]

[Out]

x*AppellF1(1/n,-1/2,-1/2,1+1/n,-2*c*x^n/(b-(-4*a*c+b^2)^(1/2)),-2*c*x^n/(b+(-4*a*c+b^2)^(1/2)))*(a+b*x^n+c*x^(
2*n))^(1/2)/(1+2*c*x^n/(b-(-4*a*c+b^2)^(1/2)))^(1/2)/(1+2*c*x^n/(b+(-4*a*c+b^2)^(1/2)))^(1/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {1362, 440} \[ \int \sqrt {a+b x^n+c x^{2 n}} \, dx=\frac {x \sqrt {a+b x^n+c x^{2 n}} \operatorname {AppellF1}\left (\frac {1}{n},-\frac {1}{2},-\frac {1}{2},1+\frac {1}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{\sqrt {\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}+1} \sqrt {\frac {2 c x^n}{\sqrt {b^2-4 a c}+b}+1}} \]

[In]

Int[Sqrt[a + b*x^n + c*x^(2*n)],x]

[Out]

(x*Sqrt[a + b*x^n + c*x^(2*n)]*AppellF1[n^(-1), -1/2, -1/2, 1 + n^(-1), (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c]), (-
2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(Sqrt[1 + (2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])]*Sqrt[1 + (2*c*x^n)/(b + Sqrt[b
^2 - 4*a*c])])

Rule 440

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
 -q, 1 + 1/n, (-b)*(x^n/a), (-d)*(x^n/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rule 1362

Int[((a_) + (c_.)*(x_)^(n2_.) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[a^IntPart[p]*((a + b*x^n + c*x^(2*n))
^FracPart[p]/((1 + 2*c*(x^n/(b + Rt[b^2 - 4*a*c, 2])))^FracPart[p]*(1 + 2*c*(x^n/(b - Rt[b^2 - 4*a*c, 2])))^Fr
acPart[p])), Int[(1 + 2*c*(x^n/(b + Sqrt[b^2 - 4*a*c])))^p*(1 + 2*c*(x^n/(b - Sqrt[b^2 - 4*a*c])))^p, x], x] /
; FreeQ[{a, b, c, n, p}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] &&  !IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\sqrt {a+b x^n+c x^{2 n}} \int \sqrt {1+\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}} \sqrt {1+\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}} \, dx}{\sqrt {1+\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}} \sqrt {1+\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}}} \\ & = \frac {x \sqrt {a+b x^n+c x^{2 n}} F_1\left (\frac {1}{n};-\frac {1}{2},-\frac {1}{2};1+\frac {1}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{\sqrt {1+\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}} \sqrt {1+\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}}} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(351\) vs. \(2(139)=278\).

Time = 0.51 (sec) , antiderivative size = 351, normalized size of antiderivative = 2.53 \[ \int \sqrt {a+b x^n+c x^{2 n}} \, dx=\frac {x \left (b n x^n \sqrt {\frac {b-\sqrt {b^2-4 a c}+2 c x^n}{b-\sqrt {b^2-4 a c}}} \sqrt {\frac {b+\sqrt {b^2-4 a c}+2 c x^n}{b+\sqrt {b^2-4 a c}}} \operatorname {AppellF1}\left (1+\frac {1}{n},\frac {1}{2},\frac {1}{2},2+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}},\frac {2 c x^n}{-b+\sqrt {b^2-4 a c}}\right )+2 (1+n) \left (a+x^n \left (b+c x^n\right )+a n \sqrt {\frac {b-\sqrt {b^2-4 a c}+2 c x^n}{b-\sqrt {b^2-4 a c}}} \sqrt {\frac {b+\sqrt {b^2-4 a c}+2 c x^n}{b+\sqrt {b^2-4 a c}}} \operatorname {AppellF1}\left (\frac {1}{n},\frac {1}{2},\frac {1}{2},1+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}},\frac {2 c x^n}{-b+\sqrt {b^2-4 a c}}\right )\right )\right )}{2 (1+n)^2 \sqrt {a+x^n \left (b+c x^n\right )}} \]

[In]

Integrate[Sqrt[a + b*x^n + c*x^(2*n)],x]

[Out]

(x*(b*n*x^n*Sqrt[(b - Sqrt[b^2 - 4*a*c] + 2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])]*Sqrt[(b + Sqrt[b^2 - 4*a*c] + 2*c*
x^n)/(b + Sqrt[b^2 - 4*a*c])]*AppellF1[1 + n^(-1), 1/2, 1/2, 2 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c]), (
2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])] + 2*(1 + n)*(a + x^n*(b + c*x^n) + a*n*Sqrt[(b - Sqrt[b^2 - 4*a*c] + 2*c*x^
n)/(b - Sqrt[b^2 - 4*a*c])]*Sqrt[(b + Sqrt[b^2 - 4*a*c] + 2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])]*AppellF1[n^(-1), 1
/2, 1/2, 1 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])])))/(2*(1 + n)^2*S
qrt[a + x^n*(b + c*x^n)])

Maple [F]

\[\int \sqrt {a +b \,x^{n}+c \,x^{2 n}}d x\]

[In]

int((a+b*x^n+c*x^(2*n))^(1/2),x)

[Out]

int((a+b*x^n+c*x^(2*n))^(1/2),x)

Fricas [F(-2)]

Exception generated. \[ \int \sqrt {a+b x^n+c x^{2 n}} \, dx=\text {Exception raised: TypeError} \]

[In]

integrate((a+b*x^n+c*x^(2*n))^(1/2),x, algorithm="fricas")

[Out]

Exception raised: TypeError >>  Error detected within library code:   integrate: implementation incomplete (ha
s polynomial part)

Sympy [F]

\[ \int \sqrt {a+b x^n+c x^{2 n}} \, dx=\int \sqrt {a + b x^{n} + c x^{2 n}}\, dx \]

[In]

integrate((a+b*x**n+c*x**(2*n))**(1/2),x)

[Out]

Integral(sqrt(a + b*x**n + c*x**(2*n)), x)

Maxima [F]

\[ \int \sqrt {a+b x^n+c x^{2 n}} \, dx=\int { \sqrt {c x^{2 \, n} + b x^{n} + a} \,d x } \]

[In]

integrate((a+b*x^n+c*x^(2*n))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(c*x^(2*n) + b*x^n + a), x)

Giac [F]

\[ \int \sqrt {a+b x^n+c x^{2 n}} \, dx=\int { \sqrt {c x^{2 \, n} + b x^{n} + a} \,d x } \]

[In]

integrate((a+b*x^n+c*x^(2*n))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(c*x^(2*n) + b*x^n + a), x)

Mupad [F(-1)]

Timed out. \[ \int \sqrt {a+b x^n+c x^{2 n}} \, dx=\int \sqrt {a+b\,x^n+c\,x^{2\,n}} \,d x \]

[In]

int((a + b*x^n + c*x^(2*n))^(1/2),x)

[Out]

int((a + b*x^n + c*x^(2*n))^(1/2), x)